DEA agents collect James Bond—MI6 agent 007—and his friend, now DEA agent Felix Leiter, on their way to Leiter's wedding in Key West, to have them assist in capturing drugs lord Franz Sanchez. Bond and Leiter capture Sanchez by attaching a hook and cord to Sanchez's plane in flight near The Bahamas and pulling it out of the air with a Coast Guard helicopter. Afterwards, Bond and Leiter parachute down to the church in time for the ceremony.
Sanchez bribes DEA agent Ed Killifer and escapes. Meanwhile, Sanchez's henchman Dario and his crew ambush Leiter and his wife Della. Leiter is maimed by a great white shark and Della is raped and killed. When Bond learns Sanchez has escaped, he returns to Leiter's house to find Della dead and Felix alive, but seriously wounded; Bond swears revenge on Sanchez. As the DEA refuses to help because Sanchez is out of its jurisdiction, Bond, with Leiter's friend Sharkey, start their own investigation into what happened to their friend. The pair discover a marine research centre run by Milton Krest, one of Sanchez's henchmen, where Sanchez has hidden cocaine and a submarine for smuggling.
After Bond kills Killifer by pushing him into the tank at the centre with the shark that maimed Leiter, M meets Bond in Key West's Hemingway House and orders him to an assignment in Istanbul, Turkey. Bond resigns after turning down the assignment, but M suspends Bond instead and immediately revokes his licence to kill. Bond flees from MI6 custody and becomes a rogue agent, bereft of official backing but later receives unauthorised assistance from MI6 armourer Q.
Bond boards the Wavekrest—a ship run by Milton Krest—and foils Sanchez's latest drug shipment, stealing five million dollars in the process, but discovers that Sharkey had been killed by Sanchez's henchmen. Bond recruits Pam Bouvier, an ex-CIA agent and pilot whom he rescues from Dario at a Bimini bar, and journeys with her to the Republic of Isthmus. In Isthmus City, Bond is met by Q. He finds his way into Sanchez's employment by posing as an assassin looking for work. Two Hong Kong Narcotics Bureau officers foil Bond's attempt to assassinate Sanchez and take him to an abandoned warehouse. They are joined by Fallon, an MI6 agent who was sent by M to apprehend Bond, dead or alive. Bond is about to be sedated via injection and sent back to the United Kingdom in disgrace when Sanchez's men rescue him and kill the officers, believing them to be the assassins. Later, with the aid of Bouvier, Q, and Sanchez's girlfriend Lupe Lamora, Bond frames Krest by placing the $5 million he had stolen into the hyperbaric chamber on board the Wavekrest. An infuriated Sanchez then traps Krest in the chamber and decompresses the pressurised chamber with an axe, explosively killing him. Meanwhile, Sanchez admits Bond into his inner circle.
Sanchez takes Bond to his base, which is disguised as a meditation retreat. Bond learns that Sanchez's scientists can dissolve cocaine in petrol and then sell it disguised as fuel to Asian drug dealers. The buying and selling are conducted via the televangelist Professor Joe Butcher, working under orders from Sanchez's business manager Truman-Lodge. The re-integration process will be available to those underworld clients who can pay Sanchez's price. During Sanchez's presentation to potential Asian customers, Dario discovers Bond and betrays him to Sanchez. Bond starts a fire in the laboratory and attempts to flee, but is captured again and placed on the conveyor belt that drops the brick-cocaine into a giant shredder. Bouvier arrives and distracts Dario, allowing Bond to pull Dario into the shredder, killing him.
Sanchez flees as fire consumes his base, taking with him four articulated tankers full of the cocaine and petrol mixture. Bond pursues them by plane, with Bouvier at the controls. During the course of a stunt-filled chase through the desert, three of the four tankers are destroyed and Bond kills many of Sanchez's men. Sanchez attacks Bond with a machete aboard the final remaining tanker, which loses control and crashes down a hill side. Soaked in petrol from the leaking tanker, Sanchez attempts to kill Bond with his machete. Bond then reveals his cigarette lighter – the Leiters' gift for being the best man at their wedding – and sets Sanchez on fire. Sanchez stumbles into the wrecked tanker, blowing it up and killing himself. Bouvier, driving the tractor from one of the destroyed tankers, arrives and rescues Bond.
Later, a party is held at Sanchez's former residence. Bond receives a call from Leiter telling him that M is offering him his job back. He then rejects Lupe's advances and romances Bouvier instead.